//
//  YTExChangeCell.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/9/11.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTExChangeCell.h"
#import "YTExchangeGoodsCell.h"
@interface YTExChangeCell()<UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;     // 列表视图
@end
@implementation YTExChangeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    
    self.tableView.rowHeight = 34;
    [self.tableView registerNib:[UINib nibWithNibName:@"YTExchangeGoodsCell" bundle:nil] forCellReuseIdentifier:@"cellID"];
}

- (void)setExList:(NSArray<YTGoodsModel *> *)exList
{
    _exList = exList;
    
    [self.tableView reloadData];
}

#pragma mark: - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.exList.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YTExchangeGoodsCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cellID" forIndexPath:indexPath];
    cell.model = self.exList[indexPath.row];
    return cell;
}

@end
